True when the last movement step ended with this instance resting on something below it. Only kept up to date while `lands_on_solids` is true. The engine writes it every step: read it, do not set it.
Works differently on Game Boy - Lands on solids works as on the Advance, except that an object at rest looks at what it stands on every second step, so it may start to fall a step late. One or two landing objects keep full speed; four at once make the game slower.
Works differently on Game Boy Color - Lands on solids works as on the Advance, except that an object at rest looks at what it stands on every second step: if its floor is taken away it starts to fall up to one step later.
On other consoles this differs: see Side by side and How the consoles differ.
on_ground: booltrue when the last movement step ended with this instance resting on something below it - a solid tile or a solid object - and false when it is in the air. The engine writes it at every movement step, so read it and do not set it.
It is kept up to date only while lands_on_solids is true. Turn that off and on_ground reads false. It also reads false before the first movement step, and an instance that is not moving at all (no gravity, no speed) leaves it as it was.
It is about "something below": with gravity_dir pointing up, a ceiling the instance rises against does not set it.
if (on_ground && btn_pressed(BTN_A)) {
vsp = -4;
}Jumps only while standing on something: the jump speed is set from the floor, and gravity brings it back down onto the next one.